function QuestionsViewModel(){
	var self = this;
	
	self.questionsMadeByUser = ko.observableArray([]);
	self.questionsMadeToUser = ko.observableArray([]);
	
	self.onGetQuestionsMadeByUserSuccess = function(questions){
		self.questionsMadeByUser($.map(questions.elements, function (question) { return new Question(question, false); }));
	};
	
	self.onGetQuestionsMadeToUserSuccess = function(questions){
		self.questionsMadeToUser($.map(questions.elements, function (question) { return new Question(question, true); }));
	};
	
	self.showQuestions = function(questions) {
		$(questions).show();
	};
	
	self.questionsMadeByUserCount = ko.computed(function(){
		return self.questionsMadeByUser().length;
	});
	
	self.questionsMadeToUserCount = ko.computed(function(){
		return self.questionsMadeToUser().length;
	});
	
	self.madeByUserPager = new Pager({ webService: "question/getQuestionsMadeByUser", params : { "pageNumber" : 1, "pageSize" : 5 }, onSuccess: self.onGetQuestionsMadeByUserSuccess });
	
	self.madeToUserPager = new Pager({ webService: "question/getQuestionsToUser", params : { "pageNumber" : 1, "pageSize" : 5 }, onSuccess: self.onGetQuestionsMadeToUserSuccess });
}